import proFetch from '../../../../hrpub/common/utils/project-fetch'

export default {
    name: 'main',
    data: {
        widget:false,
        widgetValue:'widget',
        pageInfo: {
            pageIndex: 1,
            pageSize: 10,
            total: 0,
            totalPage: 1
        }, //分页信息
        json: {}, //初始多语信息
        showPage: 'list', //默认展示列表界面 card表示展示卡片界面
        cardStatus: 'browse', //默认卡片界面为浏览状态 'edit'为编辑状态
        orderStatus: '1',//默认单据状态为待离职
        orgvalue: {} , //默认hr组织
        focusIndex: 0,//默认选中第一行
        showChangePage: false,
    },
    sync: {
        update(state, payload) {
            return {
                ...state,
                ...payload
            }
        }
    },
    async: {
        //列表数据查询
        queryTableData(dispatch, getstate, data) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionQueryHandleAction.do',
                body: data
            })
        },
        
        //查询卡片信息
        queryDataDetail(dispatch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionQueryHandInfAction.do',
                body: data
            })
        },
        //离职确认
        dismConfrim(dispatch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionConfirmAction.do',
                body: data
            })
        },
        /* 离职中止 */
        suspend(dispatch, getState, data) {
            return proFetch({
                url: `/nccloud/hrtrn/dimissionmng/DimissionSuspendAction.do`,
                body: data
            });
        },
        //小部件跳转接口
        getWidgetTableData(dispatch,getState,data){
            return proFetch({
                url: '/nccloud/hrtrn/widgets/ListData.do',
                body: data
            })
        }
    }

}